<template>
	<view>
		<view>
			<template v-if="estateAlbum.length > 0">
				<uni-swiper-dot :info="estateAlbum" :current="current" :field="description" mode="nav">
					<swiper class="swiper-box" @change="change" style="height: 538upx;">
						<swiper-item v-for="(item ,index) in estateAlbum" :key="index">
							<view class="swiper-item">
								<img :src="item.image" alt="" style="width:750upx;height: 538upx;">
							</view>
						</swiper-item>
					</swiper>
				</uni-swiper-dot>
				<image @click="skipConcernListPage" src="../../../static/images/estate/concern-file.png" class="concern-file" mode=""></image>
			</template>
		</view>
		<!-- 第一部分 -->
		<view class="d-flex flex-column border-bottom estate-title-part j-center">
			<text class="title-top">{{ estateContent.projectName }}</text>
			<view class="d-flex" style="margin: 20upx 0 40upx;">
				<uni-tag v-if="estateContent.salesState" :text="estateContent.salesState" type="success" size="small" class="tag-item"></uni-tag>
				<template v-for="(item, index) in estateContent.tags">
					<uni-tag :text="item" size="small" class="tag-item" style="margin-right: 8upx;" :key="index"></uni-tag>
				</template>
			</view>
			<view class="title-basic-info">
				<text>住宅价格：</text>
				<text style="color: #F85D5A;" v-if="estateContent.housePrice">{{ estateContent.housePrice }}</text>
			</view>
			<view class="title-basic-info">
				<text>开盘时间：</text>
				<text style="color: #333333;" v-if="estateContent.openTime">{{estateContent.openTime}}</text>
			</view>
			<view class="d-flex j-sb a-center" style="line-height: 84upx;">
				<view class="single-row-over d-flex a-center" style="width: 600upx;">
					<image src="../../../static/images/estate/location.png" style="width: 34upx;height: 42upx;margin-right: 20upx;"
					 mode=""></image>
					<text style="color: #000000;font-size: 32upx;max-width: 200upx" v-if="estateContent.houseAddress">{{estateContent.houseAddress}}</text>
				</view>
				<text style="font-size: 28upx;color: #999999;" @tap="skipToEstateLocationPage">详情></text>
			</view>
			<view class="more-info-module" @click="skipHouseDetailPage">
				<image src="../../../static/images/estate/more.png" style="width: 26upx;height: 26upx;" mode=""></image>
				<text style="margin-left: 10upx;">更多信息</text>
			</view>
		</view>
		<sun-divider></sun-divider>
		<view class="px-2 pt-2">
			<image src="../../../static/images/estate/call.png" style="height: 152upx;" mode=""></image>
			<view class="d-flex label-wrapper border-bottom">
				<view @click="switchModel(index)" class="label-item" :class="[defaultModel == index?'active':'']" v-for="(item,index) in moduleConfig"
				 :key="index">
					<text>{{item.name}}</text>
				</view>
			</view>
			<swiper @change="swiperChange" :current="defaultModel" :style="'height:' + scrollH + 'px;'">
				<swiper-item>
					<!-- 楼盘动态 -->
					<!-- <scroll-view scroll-y="true" :style="'height:' + scrollH + 'px;'"> -->
						<view v-for="(item,index) in eastateDynamic" @click="skipToEstateDetail()" :key="index" style="height: 174upx;"
						 class="d-flex j-sb mt-2 pb-2 border-bottom">
							<view class="d-flex flex-column j-sb" style="width: 388upx;">
								<text class="multi-row-3-over estate-title">{{item.title}}</text>
								<view class="d-flex a-center">
									<uni-tag v-if="item.type=='楼盘资讯'" text="楼盘资讯" size="small" type="warning"></uni-tag>
									<uni-tag v-else text="最新活动" size="small" type="primary"></uni-tag>
									<view class="d-flex a-center" style="margin-left: 30upx;">
										<image src="../../../static/images/estate/author.png" style="width: 30upx;height: 30upx;" mode=""></image>
										<text style="margin-left: 10upx;color: #999999;">{{item.author}}</text>
									</view>
								</view>
							</view>
							<view>
								<image :src="item.thumb?item.thumb:defaultLikeSrc" style="width: 242upx;height: 174upx;" mode=""></image>
							</view>
						</view>
						<view v-if="eastateDynamic.length > 1" class="more-info-module" @click="skipEstateActivePage">
							<image src="../../../static/images/estate/comment.png" style="width: 26upx;height: 26upx;" mode=""></image>
							<text style="margin-left: 10upx;">更多动态</text>
						</view>
					<!-- </scroll-view> -->
				</swiper-item>
				<swiper-item>
					<!-- 预售证 -->
					<view class="advance-sale" :style="'height:' + scrollH + 'px;'" v-for="(presellObj, index) in presellLicence" :key="index">
						<view class="font-32" style="color: #2A2A2A;margin: 30upx 0;font-weight: bold;">
							<text v-if="presellObj && presellObj.number">预售证号：{{presellObj.number}}</text>
						</view>
						<view class="d-flex j-center" style="margin-bottom: 20upx;">
							<image v-if="presellObj && presellObj.image" :src="presellObj.image" style="width: 448upx;height: 302upx;" mode=""></image>
						</view>
					</view>
				</swiper-item>
				<swiper-item>
					<!-- <view class="swiper-item"> -->
					<!-- 开盘信息 -->
					<view class="d-flex flex-column" :style="'height:' + scrollH + 'px;'" style="font-size: 28upx;padding: 40upx 10upx;"
					 v-for="(item, index) in openingInformation" :key="index">
						<view>
							<text style="color: #878787;">开盘时间：</text>
							<text>{{item.openingDate}}</text>
						</view>
						<view>
							<text style="color: #878787;">开盘详情：</text>
							<text>{{item.detail}}</text>
						</view>
						<view>
							<text style="color: #878787;">开盘楼盘：</text>
							<text>{{item.buildings}}</text>
						</view>
					</view>
					<!-- </view> -->
				</swiper-item>
				<swiper-item>
					<!-- <view class="swiper-item"> -->
					<!-- 交房信息 -->
					<view class="d-flex flex-column" :style="'height:' + scrollH + 'px;'" style="font-size: 28upx;padding: 40upx 10upx;"
					 v-for="(item, index) in houseDelivery" :key="index">
						<view>
							<text style="color: #878787;">交房时间：</text>
							<text>{{item.date}}</text>
						</view>
						<view>
							<text style="color: #878787;">交房详情：</text>
							<text>{{item.detail}}</text>
						</view>
						<view>
							<text style="color: #878787;">交房楼栋：</text>
							<text>{{item.building}}</text>
						</view>
					</view>
					<!-- </view> -->
				</swiper-item>
			</swiper>
		</view>
		<sun-divider></sun-divider>
		<!-- 户型展示 -->
		<view class="estate-intro-part px-2" style="width: 710upx;padding-bottom: 14upx;">
			<view class="apart-chapter">
				<text class="module-title">主力户型({{estateApart.length}})</text>
				<text @click="skipApartLayoutPage" class="font-24" style="color: #999999;">查看更多></text>
			</view>
			<apart-slide style="margin-top: 28upx;" :dataList="estateApart"></apart-slide>
		</view>
		<sun-divider></sun-divider>
		<!-- 专家评楼 -->
		<view class="estate-intro-part px-2" style="width: 710upx;">
			<view class="apart-chapter">
				<text class="module-title">专家评楼</text>
				<text @click="skipExportEstatePage" class="font-24" style="color: #999999;">查看全部></text>
			</view>
			<view>
				<view v-for="(item,index) in estateExport" :key="index" :class="[index == estateExport.length - 1?'':'border-bottom']" class="d-flex flex-column" style="padding: 40upx 0;">
					<view class="d-flex a-center" style="height: 80upx;">
						<image :src="item.headImage" style="width: 76upx;height: 76upx;border-radius: 38upx;" mode=""></image>
						<view class="d-flex flex-column" style="margin-left: 10upx;">
							<view class="d-flex a-center" style="line-height: 44upx;height: 44upx;">
								<text style="margin-right:10upx;font-size: 32upx;color: #2A2A2A;font-weight: bold;">{{item.name}}</text>
								<image src="../../../static/images/estate/award.png" style="width: 28upx;height: 28upx;" mode=""></image>
							</view>
							<view class="d-flex">
								<view class="custom-tag" v-for="(item1,index1) in item.tags" :key="index1">
									<text>{{item1}}</text>
								</view>
							</view>
						</view>
					</view>
					<view style="margin-top: 14upx;line-height: 44upx;">
						<text style="font-size: 32upx;">{{item.title}}</text>
					</view>
				</view>
			</view>
		</view>
		<sun-divider></sun-divider>
		<!-- 用户评论 -->
		<view class="estate-intro-part px-2" style="width: 710upx;padding-bottom: 14upx;">
			<view class="apart-chapter">
				<text class="module-title">用户评论({{estateComment.length}})</text>
				<text @click="skipUserCommentPage" class="font-24" style="color: #999999;">查看全部></text>
			</view>
			<view>
				<view v-for="(item,index) in showEstateComment" :key="index" class="d-flex flex-column border-bottom" style="padding: 36upx 0;">
					<view class="d-flex a-center" style="height: 80upx;">
						<image src="../../../static/images/estate/author.png" style="width: 76upx;height: 76upx;border-radius: 38upx;"
						 mode=""></image>
						<view class="d-flex flex-column j-sb" style="margin-left: 10upx;height: 80upx;margin-top: -16upx;">
							<text style="font-size: 32upx;color: #2A2A2A;font-weight: bold;">{{item.userName}}</text>
							<uni-rate size="20" :activeColor="starColor" :value="item.score"></uni-rate>
						</view>
					</view>
					<view style="margin-top: 20upx;">
						<text style="font-size: 28upx;color: #2A2A2A;line-height: 44upx;">{{item.content}}</text>
					</view>
				</view>
			</view>
			<view class="more-info-module" v-if="!commentPartVisible" @click="showCommentContent()">
				<image src="../../../static/images/estate/comment.png" style="width: 26upx;height: 26upx;" mode=""></image>
				<text style="margin-left: 10upx;">我要点评</text>
			</view>
			<!-- <uni-rate size="32" :activeColor="starColor" value="4.6"></uni-rate> -->
			<view class="personal-comment-part" v-if="commentPartVisible">
				<view class="d-flex flex-column">
					<view v-for="(item,index) in rateConfig" :key="index" class="d-flex a-center" style="height: 72upx;">
						<text style="margin-right: 20upx;">{{item.field}}</text>
						<uni-rate size="32" :activeColor="starColor" :customFlag="index" :value="commentRate" @rateChange="getNewRate"></uni-rate>
						<text style="margin-left: 60upx;">{{item.text}}</text>
					</view>
				</view>
				<view>
					<text>综合评分：<text style="color: red;font-size: 40upx;">{{comprehensiveScore}}</text></text>
				</view>
				<text>点评内容</text>
				<input type="textarea" placeholder="输入点评内容" rows="6" class="sun-textarea" v-model="comentContent"/>
			    <view class="more-info-module" @click="submitComment()">
				    <image src="../../../static/images/estate/comment.png" style="width: 26upx;height: 26upx;" mode=""></image>
				    <text style="margin-left: 10upx;">提交点评</text>
	            </view>
			</view>
		</view>
		<!-- 大家都在问 -->
		<view class="estate-intro-part px-2" style="width: 710upx;padding-bottom: 14upx;">
			<view class="apart-chapter">
				<text class="module-title">大家都在问({{questions.length}})</text>
				<text @click="skipToQuestionPage()" class="font-24" style="color: #999999;">查看全部></text>
			</view>
			<view style="margin-top: 30upx;">
				<view v-for="(item,index) in showQuestions" :key="index" style="font-size: 28upx;">
					<view class="d-flex j-sb" style="line-height: 60upx;">
						<view class="d-flex a-center">
							<uni-tag text="问" size="small" type="error" style="margin-right: 20upx;"></uni-tag>
							<text style="color: #2A2A2A;">{{item.content}}</text>
						</view>
						<text style="color: #999999;">{{item.questionList.length}}个回答</text>
					</view>
					<view class="d-flex a-center" v-if="item.questionList.length > 0" style="line-height: 60upx;">
						<uni-tag text="答" size="small" type="success" style="margin-right: 20upx;"></uni-tag>
						<text style="color: #2A2A2A;">{{item.questionList[0].content}}</text>
					</view>
				</view>
			</view>
			<view v-show="!showQuestionBox" class="more-info-module" @tap="startQuestion()">
				<image src="../../../static/images/estate/question.png" style="width: 26upx;height: 26upx;" mode=""></image>
				<text style="margin-left: 10upx;">我要提问</text>
			</view>
			<view style="margin-top: 10upx;" class="personal-comment-part" v-show="showQuestionBox">
				<text>提问内容</text>
				<input type="textarea" placeholder="输入提问信息" rows="6" class="sun-textarea" v-model="questionContent"/>
				<view v-show="showQuestionBox" class="more-info-module" @tap="saveQuestion()">
					<image src="../../../static/images/estate/question.png" style="width: 26upx;height: 26upx;" mode=""></image>
					<text style="margin-left: 10upx;">提交提问</text>
				</view>
			</view>
		</view>
		<sun-divider></sun-divider>
		<!-- 周边配套 -->
		<view class="estate-intro-part px-2" style="width: 710upx;padding-bottom: 14upx;">
			<view class="apart-chapter">
				<text class="module-title">周边配套</text>
				<text @click="skipAroundFacilitiesPage('公交')" class="font-24" style="color: #999999;">查看全部></text>
			</view>
			<view style="margin-top: 20upx;">
				<map style="width: 100%; height: 372upx;" :latitude="latitude" :longitude="longitude" :markers="this.covers">
				</map>
			</view>
			<view class="d-flex a-center" style="justify-content: space-around;height: 88upx;margin-top: 20upx;">
				<view class="active" @click="skipAroundFacilitiesPage('公交')">
					<text class="iconfont icon-gongjiaoche"></text>
					<text style="font-weight: bold;margin-left: 6upx;">公交</text>
				</view>
				<view>
					<text class="iconfont icon-xuexiao"></text>
					<text style="font-weight: bold;margin-left: 6upx;">学校</text>
				</view>
				<view>
					<text class="iconfont icon-canyin"></text>
					<text style="font-weight: bold;margin-left: 6upx;">餐饮</text>
				</view>
				<view>
					<text class="iconfont icon-ziyuan"></text>
					<text style="font-weight: bold;margin-left: 6upx;">购物</text>
				</view>
			</view>
		</view>
		<sun-divider></sun-divider>
		<!-- 猜你喜欢 -->
		<view class="estate-intro-part px-2" style="width: 710upx;padding-bottom: 14upx;">
			<view class="apart-chapter">
				<text class="module-title">猜你喜欢</text>
				<!-- <text @click="skipUserCommentPage" class="font-24" style="color: #999999;">查看全部></text> -->
			</view>
			<view>
				<view v-for="(item,index) in customLikes" @click="skipToEstateDetailPage(item.id)" :key="index" style="padding: 20upx 0;"
				 class="d-flex flex-column j-sb border-bottom">
					<view class="d-flex j-sb">
						<view style="margin-right: 34upx;">
							<image :src="item.thumb?item.thumb:defaultLikeSrc" style="width: 242upx;height: 190upx;border-radius: 8upx;"
							 mode=""></image>
						</view>
						<view class="d-flex flex-column" style="width: 428upx;">
							<text style="font-size: 32upx;font-weight: 600;line-height: 40upx;">{{item.projectName}}</text>
							<text style="color: red;font-size: 28upx;line-height: 40upx;">{{item.housePrice}}元/㎡</text>
							<text class="single-row-over" style="margin-bottom: 2px;">{{item.houseAddress}}/{{item.area}}</text>
							<view class="d-flex a-center" style="flex-wrap: wrap;">
								<uni-tag :text="item.salesState" style="margin-right: 6upx;margin-bottom: 4upx;" size="small" type="success"></uni-tag>
								<uni-tag v-for="(item1,index1) in item.tags.split(' ')" style="margin-right: 4upx;margin-bottom: 4upx;" :key="index1"
								 :text="item1" size="small"></uni-tag>
							</view>
						</view>
					</view>
					<view class="d-flex a-center" style="font-size: 24upx;">
						<image src="../../../static/images/estate/light.png" style="width: 26upx;height: 26upx;" mode=""></image>
						<text style="margin-left: 20upx;font-weight: bold;">楼盘亮点</text>
						<text style="margin-left: 20upx;">{{item.lightSpot}}</text>
					</view>
				</view>
			</view>
			<view class="more-info-module">
				<image src="../../../static/images/estate/moreHouse.png" style="width: 26upx;height: 26upx;" mode=""></image>
				<text style="margin-left: 10upx;">更多房源</text>
			</view>
		</view>
		<sun-divider></sun-divider>
		<view class="white-space"></view>
	</view>
</template>

<script>
	import api from '@/common/lib/request.js';
	import sunDivider from '@/components/common/sun-divider.vue';
	import apartSlide from '@/components/module/apart-slide.vue';
	import uniSwiperDot from "@/components/uni-ui/uni-swiper-dot/uni-swiper-dot.vue";
	import uniTag from "@/components/uni-ui/uni-tag/uni-tag.vue";
	import uniRate from '@/components/uni-ui/uni-rate/uni-rate.vue';
	export default {
		data() {
			return {
				defaultLongitude: 0,
				defaultLatitude: 0,
				longitude: this.defaultLongitude,
				latitude: this.defaultLatitude,
				covers: [{
					longitude: this.defaultLongitude,
					latitude: this.defaultLatitude,
					iconPath: '../../../static/images/estate/location.png',
					title: ''
				}],
				showQuestionBox: false,   //显示提问输入框的标志
				srcInactive: '../../../static/images/estate/concern.png',
				srcActive: '../../../static/images/estate/concern-active.png',
				defaultLikeSrc: '../../../static/images/shuijiao.jpg', //猜你喜欢的默认配图
				scrollH: 281,
				customLikes: [], //猜你喜欢
				commentRate: 0,
				comentContent: "",  //点评内容
				commentPartVisible: false,   //点评部分是否展示
				defaultModel: 0,
				contentId: '',
				token: '',
				starColor: '#23C996',
				description: 'str',
				detailSource: {},
				estateContent: {}, //主体内容
				eastateDynamic: [], //楼盘动态
				estateApart: [], //户型展示
				estateAlbum: [], //相册
				estateExport: [], //专家评楼
				estateComment: [], //总的用户评论列表
				showEstateComment: [], //首页要展示的用户评论列表
				houseDelivery: {}, //交房信息
				openingInformation: {}, //开盘信息
				questions: [], //大家都在问
				showQuestions: [],  //要展示的提问信息
				concernFlag: 0,
				current: 0,
				maskTop: 0,
				questionContent:"",
				moduleConfig: [
				{
					id: 0,
					name: '楼盘动态'
				}, {
					id: 1,
					name: '预售证'
				}, {
					id: 2,
					name: '开盘信息'
				}, {
					id: 3,
					name: '交房信息'
				}],
				presellLicence: '', // 预售证
				rateConfig:[
					{
						"field": "价格",
						"value": 4.2,
						"text": "暂无评分"
					},
					{
						"field": "地段",
						"value": 0,
						"text": "暂无评分"
					},
					{
						"field": "交通",
						"value": 0,
						"text": "暂无评分"
					},
					{
						"field": "配套",
						"value": 0,
						"text": "暂无评分"
					},
					{
						"field": "环境",
						"value": 0,
						"text": "暂无评分"
					}
				]
			}
		},
		computed:{
			comprehensiveScore(){
				let ratePlus = 0;
				this.rateConfig.forEach(item => {
					ratePlus = ratePlus + item.value;
				})
				return (ratePlus/5).toFixed(1)
			}
		},
		components: {
			sunDivider,
			apartSlide,
			uniSwiperDot,
			uniTag,
			uniRate
		},
		watch: {
			defaultModel(newVal) {
				switch (newVal) {
					case 0:
						this.scrollH = 281;
						break;
					case 1:
						this.scrollH = 228;
						break;
					case 2:
					case 3:
						this.scrollH = 120;
						break;
				}
			}
		},
		onLoad(options) {
			if (options.contentId) {
				this.contentId = options.contentId;
				// this._getEstateDetail(options.contentId)
				// this.getCustomLikes()
				// let node = uni.getSubNVueById("tabbarSub");
				uni.$on('update-status', (data) => {
					if(data.id !== this.contentId) return;
					if (data.flag) {
						this.addConcern(data);
					} else {
						this.cancelConcern(data);
					}
				})
			}
		},
		onShow() {
			this._getEstateDetail(this.contentId)
			this.getCustomLikes()
		},
		methods: {
			swiperChange(event) {
				let currentIdx = event.detail.current;
				this.defaultModel = currentIdx;
			},
			getNewRate(obj){
				this.rateConfig[obj.customFlag].value = obj.value;
				this.rateConfig[obj.customFlag].text = obj.value + "分";
			},
			showCommentContent(){
				let token = uni.getStorageInfoSync('token');
				if(token){
					this.commentPartVisible = true;
				}else{
					uni.navigateTo({
						url:"/pages/mine/login/login"
					})
				}
			},
			/**
			 * 提交点评内容
			 */
			submitComment(){
				let _this = this;
				if(this.comentContent.trim() == "" || this.comprehensiveScore == 0){
					return
				}
				api.request({
						url: '/lpxx/comment/save',
						data: {
							contentId: _this.contentId,
							content: _this.comentContent,
							score: _this.comprehensiveScore
						}
					})
					.then(response => {
						this.commentPartVisible = false;
						this.estateComment.push([])
					})
					.catch(err => {
						console.log(err);
					});
			},
			_getEstateDetail(id) {
				let _this = this;
				api.request({
						url: '/content/lpxxInfo/new',
						data: {
							contentId: id
						}
					})
					.then(response => {
						_this.concernFlag = response.collected ? 1 : 0;
						uni.$emit('receive-init-status',{flag: _this.concernFlag,id: _this.contentId})
						_this.estateContent = response.content ? response.content : {}
						_this.eastateDynamic = response.housesDynamics.length > 0 ? response.housesDynamics.slice(0, 2) : []
						_this.estateApart = response.houseType ? response.houseType : []
						_this.estateAlbum = response.photos.length > 0 ? response.photos : []
						_this.estateAlbum = _this.estateAlbum.map(item => {
							return {
								image: item.image,
								str: ''
							}
						})
						_this.detailSource = response.comment ? response.comment : [];
						_this.estateExport = response.expertCommentary.length > 0 ? response.expertCommentary.slice(0,2) : [];
						_this.estateComment = response.comment.length > 0 ? response.comment : [];
						_this.showEstateComment = response.comment.length > 0 ? response.comment.slice(0,2) : [];
						_this.houseDelivery = response.houseDelivery;
						_this.openingInformation = response.openingInformation;
						_this.questions = response.question.length > 0 ? response.question : [];
						_this.showQuestions = response.question.length > 0 ? response.question.slice(0,1) : [];
						if (response.content.longitude && response.content.latitude) {
							_this.longitude = response.content.longitude;
							_this.latitude = response.content.latitude;
							_this.covers = [{
								longitude: response.content.longitude,
								latitude: response.content.latitude,
								iconPath: '../../../static/images/estate/location.png',
								title: response.content.projectName
							}]
						}
						_this.presellLicence = response.presellLicence;
					})
					.catch(err => {
						console.log(err);
					});
			},
			getCustomLikes() {
				let _this = this;
				let locationInfo = uni.getStorageSync('location');
				api.request({
					url: '/lpxx/recommend',
					data: {
						contentId: _this.contentId,
						siteId: JSON.parse(locationInfo).id
					}
				}).then(response => {
					this.customLikes = response;
				}).catch(err => {
					console.log(err);
				});
			},
			switchModel(idx) {
				this.defaultModel = idx;
			},
			change(e) {
				this.current = e.detail.current;
			},
			startQuestion(){
				this.questionContent = "";
				this.showQuestionBox = true;
			},
			// 保存提问信息
			saveQuestion(){
				let _this = this;
				api.request({
						url: '/lpxx/question/save',
						data: {
							contentId: this.contentId,
							type: 1,
							content: this.questionContent
						}
					})
					.then(response => {
						_this.showQuestionBox = false;
						uni.showToast({
							title:"提交成功"
						})
					})
					.catch(err => {
						console.log(err);
					});
			},
			skipApartLayoutPage() {
				uni.navigateTo({
					url: '/pages/estate/apartLayout/apartLayout?contentId=' + this.contentId
				})
			},
			skipUserCommentPage() {
				uni.navigateTo({
					url: '/pages/estate/userComment/userComment?contentId=' + this.contentId
				})
			},
			skipEstateActivePage() {
				uni.navigateTo({
					url: '/pages/estate/estateActive/estateActive?contentId=' + this.contentId
				})
			},
			skipExportEstatePage() {
				uni.navigateTo({
					url: '/pages/estate/exportEstate/exportEstate?contentId=' + this.contentId
				})
			},
			skipHouseDetailPage() {
				uni.navigateTo({
					url: '/pages/estate/houseDetail/houseDetail?contentId=' + this.contentId
				})
			},
			skipToEstateDetailPage(id) {
				uni.navigateTo({
					url: '/pages/estate/estateDetail/estateDetail?contentId=' + id
				})
			},
			skipToEstateDetail() {
				uni.navigateTo({
					url: '/pages/estate/dynamicDetail/dynamicDetail?contentId=' + this.contentId
				})
			},
			skipAroundFacilitiesPage(label){
				uni.navigateTo({
					url: '/pages/estate/aroundFacilities/aroundFacilities?type=' + label + '&position=' + encodeURIComponent(JSON.stringify(this.covers))
				})
			},
			//跳转到收藏界面
			skipConcernListPage() {
				let token = uni.getStorageSync('token');
				if(token){
					uni.navigateTo({
						url: '/pages/specialPage/concernList/concernList'
					})
				}else{
					uni.navigateTo({
						url: '/pages/mine/login/login'
					});
				}
			},
			skipToQuestionPage() {
				uni.navigateTo({
					url: "/pages/estate/questionList/questionList?contentId=" + this.contentId + "&title=" + this.estateContent.projectName
				})
			},
			skipToEstateLocationPage(){
				uni.navigateTo({
					url: "/pages/estate/estateLocate/estateLocate?position="+ encodeURIComponent(JSON.stringify(this.covers))
				})
			},
			// 添加关注
			addConcern(data) {
				let _this = this;
				api.request({
						url: '/lpxx/collect/building-save',
						data: {
							contentId: data.id
						}
					})
					.then(response => {
						_this.concernFlag = 1
					})
					.catch(err => {
						console.log(err);
					});
			},
			//取消收藏
			cancelConcern(data) {
				let _this = this;
				api.request({
						url: '/lpxx/collect/building/delete',
						data: {
							contentId: data.id
						}
					})
					.then(response => {
						_this.concernFlag = 0
					})
					.catch(err => {
						console.log(err);
					});
			}
		}
	}
</script>

<style scoped>
	.estate-title-part {
		width: 710upx;
		padding: 0 20upx;
	}

	.title-top {
		font-family: PingFang-SC-Bold;
		font-size: 48upx;
		color: #333333;
		letter-spacing: 0;
		font-weight: bold;
	}
	.sun-textarea{
		background-color: #eee;
		width: 100%;
		height: 240upx;
		border-radius: 36upx;
		/* width: 480upx; */
		text-indent: 36upx;
		font-size: 32upx;
	}

	.more-info-module {
		display: flex;
		justify-content: center;
		align-items: center;
		background: #F5FAFF;
		border-radius: 8upx;
		height: 74upx;
		font-family: PingFangSC-Regular;
		font-size: 28upx;
		color: #005BAD;
		letter-spacing: 0;
		margin: 20upx 0;
	}

	.title-basic-info {
		font-size: 28upx;
		color: #878787;
		line-height: 60upx;
	}

	.estate-title {
		font-size: 32upx;
		color: #333333;
		line-height: 42upx;
	}

	.label-wrapper {
		align-items: center;
		justify-content: space-around;
		font-size: 32upx;
		height: 84upx;
		text-align: center;
	}

	.label-item.active {
		height: 40px;
		border-bottom: 2px solid #005BAD;
		display: flex;
		align-items: center;
	}

	.label-wrapper .active {
		color: #005BAD;
	}

	.tag-item {
		margin-right: 6upx;
		color: #9B9B9B;
	}

	.bottom-part {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 9999;
		padding: 0 40upx;
		height: 90upx;
		background: #FFFFFF;
	}

	.apart-chapter {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 40upx;
	}

	.advance-sale {}

	.tags {
		font-size: 16upx;
		border-radius: 2upx;
		height: 26upx;
		line-height: 26upx;
		text-align: center;
	}

	.custom-tag {
		background: #FFFFFF;
		border: 2upx solid #C9C9C9;
		border-radius: 2upx;
		font-size: 24upx;
		color: #333333;
		text-align: center;
		line-height: 38upx;
		padding: 0 10upx;
		height: 34upx;
		margin-right: 10upx;
	}

	.tag-1 {
		width: 50upx;
		background: rgba(242, 156, 159, .24);
		margin-right: 12upx;
	}

	.tag-2 {
		width: 96upx;
		background: rgba(136, 171, 218, .24);
	}

	.basic-info {
		display: flex;
		align-items: center;
		height: 80upx;
		border-bottom: 1upx solid #DDDDDD;
		font-size: 28upx;
		color: #999999;
	}

	.basic-info .iconfont {
		margin-right: 10upx;
	}

	.module-title {
		font-size: 36upx;
		color: #2A2A2A;
		font-weight: bold;
	}

	.detail-module {
		display: flex;
		flex-direction: column;
		color: #999999;
		font-size: 28upx;
	}

	.active {
		color: #005BAD !important;
	}

	.active-concern {
		color: #F85D5A !important;
	}

	.white-space {
		height: 90upx;
		width: 100%;
	}

	.concern-file {
		position: absolute;
		top: 110upx;
		right: 38upx;
		width: 40upx;
		height: 38upx;
	}
	.mask{
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index:999;
		width:100%;
		height:100vh;
		background:rgba(0,0,0,0.4);
	}
	.comment-area {
		/* position: fixed;
		top: 0upx; */
		background-color: white;
		width: 670upx;
		padding: 0 40upx;
		height: 90upx;
	}
	
	.comment-input {
		background-color: #eee;
		height: 72upx;
		border-radius: 36upx;
		width: 480upx;
		text-indent: 36upx;
		font-size: 32upx;
	}
	
	.comment-btn {
		width: 160upx;
		height: 72upx;
		border-radius: 36upx;
		background-color: orange;
		color: white;
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>
